package view;

import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;

import javax.swing.JFrame;
import javax.swing.JPanel;

import model.Player;

public class PlayGround extends JPanel {

	ArrayList<Player> player;
	private JFrame jframe;

	public PlayGround(ArrayList<Player> player) {
		this.player = player;

		this.jframe = new JFrame("Tron LAN");
		this.jframe.setResizable(false);
		this.setBackground(Color.BLACK);
		this.jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.jframe.setSize(800, 600);
		this.jframe.add(this);
		this.jframe.setLocationRelativeTo(null);
		this.jframe.setVisible(true);
	}

	@Override
	public void paint(Graphics g) {
		super.paint(g);
		for (Player p : this.player) {
			p.paint(g);
		}
	}

}
